package com.zerous.simplerts;

import android.app.*;
import android.os.*;
import android.graphics.*;
import android.view.*;
import com.zerous.simplerts.screens.*;

public class Game extends Activity 
{
	GameView gameView;
	Screen currentScreen;
	
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		Display d = getWindowManager().getDefaultDisplay();
		Bitmap framebuffer = Bitmap.createBitmap(d.getWidth(), d.getHeight(), Bitmap.Config.ARGB_8888);
		gameView = new GameView(this, framebuffer);
		Zef.graphics = new ZGraphics(framebuffer);
		Zef.file = new ZFileIO(this);
		Zef.input = new ZInput(gameView);
		currentScreen = new LoadingScreen(this);
		
		
        setContentView(gameView);
    }
	
	public void setScreen(Screen s)
	{
		currentScreen = s;
	}

	@Override
	protected void onPause()
	{
		super.onPause();
		
		//if(gameView != null)
			gameView.pause();
	}

	@Override
	protected void onResume()
	{
		super.onResume();
		
		//if(gameView != null)
			gameView.resume();
	}
}
